package bishi.jingdong;

import java.util.Scanner;

public class demo2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        while(t > 0) {
            int n = in.nextInt();
            int k = in.nextInt();

            int[] arr = new int[n];
            for(int i = 0;i < n;i++) {
                arr[i] = in.nextInt();
            }

            int max = 0;
            for(int i = 1;i < n;i++) {
                max = Math.max(max,Math.abs(arr[i] - arr[i - 1]));

            }

            int left = 0;
            int right = max;
            int a = max;
            while(left < right) {
                int m = (left+right) /2;
                if(check(arr,k,m)) {
                    a = m;
                    right = m -1;
                }else {
                    left = m + 1;
                }
            }
            System.out.println(a);


            t--;
        }
    }

    static boolean check(int[] arr,int k,int m) {
        int cost = 0;
        int[] temp = arr.clone();
        for(int i = 1;i < temp.length;i++) {
            if(temp[i - 1] - temp[i] > m) {
                int ss = temp[i - 1]  - m;
                cost += ss - temp[i];
                temp[i] = ss;
                if(cost > k) {
                    return false;
                }
            }
        }
        return cost<=k;
    }
}
